package classDemo;

/**
 * Created by AJie on 2019/7/26
 * Function :
 * 完美预测
 * todo 验证ClassLoad 2
 * static 属性
 * 在同一个类加载器下面只能初始化类一次,如果已经初始化了就不必要初始化了.
 *
 * Singleton3  block ！！！
 * Singleton3 new instance
 * Singleton3 static block
 * Singleton3  block ！！！
 * Singleton3 new instance
 */
public class ClassLoad3 {
    public static void main(String args[]){
        Singleton3 singleton3 = Singleton3.getSingleton3();
    }
}
class Singleton3 {
    private static Singleton3 singleton3 = new Singleton3();

    private Singleton3() {
        System.out.println("Singleton3 new instance");
    }

    public static Singleton3 getSingleton3() {
        return new Singleton3();
    }

    static {
        System.out.println("Singleton3 static block");
    }

    {
        System.out.println("Singleton3  block ！！！ ");
    }

}
